package com.qdlc.p2p.dal.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.dal.common.dao.jpa.BaseDaoImpl;
import com.qdlc.p2p.dal.dao.UserVipDao;
import com.qdlc.p2p.dal.dto.UserVip;

@Repository("userVipDao")
public class UserVipDaoImpl extends BaseDaoImpl<UserVip> implements UserVipDao {

	@Override
	public UserVip findByUserId(long userId) {
		String sql = "select * from " + Global.DB_PREFIX + "user_vip where user_id=:userId";
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("userId", userId);
		UserVip userVip = findForUniqueBySql(sql, params);
		return userVip;
	}
	
}
